package com.zzxy.springmvc12.controller;
import com.zzxy.springmvc12.po.Student;
import com.zzxy.springmvc12.po.StudentExt;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/stu")
public class StudentController {
    @RequestMapping("/register")
    public  String register(){
        return "/user/register";
    }
    @RequestMapping("/addstu")
    public  String addStu(String username ,String password){
        System.out.println(username);
        System.out.println(password);
    return "/user/userList";
}
    @RequestMapping("/addstu1")
    public  String addStu1(Student student){
       System.out.println(student);
        return "/user/userList";
    }
    @RequestMapping("/addstu2")
    public  String addStu2(StudentExt ext){
        //System.out.println(ext);
//        for (Student student:ext.getStudentList()){
//            System.out.println(student);
//        }
        System.out.println(ext);
        return "/user/userList";
    }
    @RequestMapping("/test")
    public  String test(){
      return "forward:/stu/register.do";
    }
    @RequestMapping("/test1")
    public  String test1(){
        return "redirect:/stu/register.do";
    }
}
